{% extends "home/base.html" %}

{% block menu %}
	<td valign='middle'>                
		<span class='menu-item' onclick='onAllGirls( this )'>Все девушки</span>
		<span class='menu-item fancybox' href='#filter-lads'>Фильтр</span>
		<script type='text/javascript'>
			var trackId;

			var m = document.location.href.match( /track-id=(\w+)/i );
			
			if( m != null )
			{
				trackId = m[ 1 ];
				document.write( "<a class='menu-item fancybox' href='#add-lad'>Добавить девушку</a>" );
				document.write( "<a class='menu-item fancybox' href='/how-many/?track-id=" + trackId + "'>Сколько добавлено?</a>" );
			}		
			else
			{
				document.write( "<a class='menu-item fancybox'>Используйте track-id для добавления</a>" );
			}
		</script>
	</td>						               
{% endblock %}

{% block head %}
    <!-- fancybox -->  		     
    <link rel="stylesheet" type="text/css" href="/static/fancybox/source/jquery.fancybox.css">		 
<script src='/static/fancybox/source/jquery.fancybox.pack.js' type='text/javascript'></script> 		     
    <link rel="stylesheet" type="text/css" href="/static/fancybox/source/helpers/jquery.fancybox-buttons.css">		 		 
<script src='/static/fancybox/source/helpers/jquery.fancybox-media.js' type='text/javascript'></script>  		     
    <link rel="stylesheet" type="text/css" href="/static/fancybox/source/helpers/jquery.fancybox-thumbs.css">				 		 
<script src='/static/fancybox/source/helpers/jquery.fancybox-thumbs.js' type='text/javascipt'></script>
    <!-- end of fancybox --> 		 		 		 
    <script type='text/javascript' src='/static/js/lazy-loader.js'></script>

    <script type='text/javascript' src='/static/js/viewer.js'></script>
	{% endblock %}
	{% block body %}
	<div id='thumbnail' style='display: none'>
  		<table cellpadding='0px' cellspacing='0px'>
  			<tr height='40px'>
  				<td colspan='2'>
  					<span class='form-caption'>Настройка фотографии</span>
  				</td>
			</tr>
			<tr>
				<td colspan='2'>
					<img id='image' src=''>
				</td>
			</tr>
  		</table>
  	</div>

  	<div id='found' style='display: none'>
  		Такая девушка уже была добавлена.
  	</div>

  	{% include "home/item.html" with id='' container_id='item-template' hidden='true' %}

  	<div id='not-found-template' style='display: none; padding: 20px'>
  		<b>Этому фильтру не соответствует ни одна девушка.</b>
  	</div>

  	<div style='display: none'>
  		<div id='filter'>
  			<form id='filter-form'>
				<table cellpadding='0px' cellspacing='0px'>							               
					<tr height='40px'>								
						<td>									                   
							<span class='form-caption'>Имя, фамилия</span>								
						</td>								
						<td>                  
							<div style='margin-left: 10px'>                    
								<input name='name_surname' type='text' style='border: 1px solid black' class='form-font'>                  
							</div>
						</td>							               
					</tr>							               
				</table>
  			</form>
  		</div>
  	</div>

  	<div style='display: none'>
  		{% include "home/form.html" with name='filter-lads' onclick='filterLadsByForm()' %}
  	</div>
     
    <div style='display: none'>        				 				         
      {% include "home/form.html" with name='add-lad' add_lad=1 onclick='addLad()' %}
    </div>		       
  {% endblock %}

	{% block container %}
      	{% for lad in lads %} 				           
      		{% include "home/item.html" with onclick_func="showPhotos" id=lad.id slug=lad.slug name_surname=lad.name_surname career=lad.get_career_display img_src=lad.thumbnail_url %}
        {% endfor %} 			         
	{% endblock %}

	{% block footer %}
		{% if next_page %}<td><a id='next-page' href='/viewer?page={{next_page}}'>Следующая страница</a></td>{% endif %}
	{% endblock %}